﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyVoteMVC.Data;
using MyVoteMVC.Domain;
using MyVoteMVC.Common;
using MyVoteMVC.Common.Objects;
using MyVoteMVC.Data.Repositories;
using MyVoteMVC.ExcelObject;

namespace MyVoteMVC.Service
{
    public interface IItemService : IDisposable
    {
        //增加
        bool CreateItems(string questionID, string projectID,string itemTitle, string itemContent, int IfDefault, string userEmailName, byte[] itemImage);

        //编辑
        bool EditItems(string questionID,string projectID, string itemID, string itemTitle, string itemContent,int IfDefault,string userEmailName);

        //删除
        bool DeleteItems(string questionID, string itemID);

        //投票 非离线
        bool AddItemsCountOnline(string questionID, string itemID, int addCount);

        //投票 离线
        bool EditItemsCountOffline(string questionID, string itemID, int Count);

        int GetItemsALLCount(string questionID, string itemID);

        int GetItemsOnlineCount(string questionID, string itemID);

        int GetItemsOfflineCount(string questionID, string itemID);

        /// <summary>
        /// 获取投票项目信息
        /// 选项按选项名称排序
        /// </summary>
        /// <param name="questionID"></param>
        /// <returns></returns>
        IList<VT_Items> GetItemsList(string questionID);
        /// <summary>
        /// 根据问题id跟关键字获取选项
        /// 选项按选项名称排序
        /// </summary>
        /// <param name="questionID"></param>
        /// <param name="keyword"></param>
        /// <returns></returns>
        IList<VT_Items> GetItemsList(string questionID,string keyword);

        //获取单个投票项目信息
        VT_Items GetItems(string questionID, string itemID);
        VT_Items GetItems(string itemID);

        void AddItemsViewCount(string itemID);

        //获取上次活动的itemm集合
        IList<VT_Items> GetLastActiviteItemms(string lastActiviteID);

        bool CreateItems(List<VT_Items> v_Items, string CreateBy);

        IList<VT_Items> GetLastActiviteItemms(string lastActiviteID, string keyword);

        IList<VT_Items> GetLastActiviteVoteItemms(string lastActiviteID);

        /// <summary>
        ///  对只带一个问题的活动 采用 IList<ExcelItem>
        ///  对带多个问题的活动 采用  IList<ExcelItemEx>
        /// </summary>
        /// <param name="activityId"></param>
        /// <returns></returns>
        List<ExcelObject.IExcelItem> GetExcelItems(string activityId);
    }
}
